import * as types from '../types'

const state = {
    permissions: [],
    others: {}
};

const actions = {
    setPermissions({ commit }, status) {
        commit(types.PERMISSIONS, status)
    },
    setOthers({ commit }, status) {
        commit(types.OTHERS, status)
    }
};

const getters = {
    permissions: state => state.permissions,
    WaitForAudit: state => state.others.WaitForAudit,
    AlreadyLaunched: state => state.others.AlreadyLaunched,
    Audited: state => state.others.Audited,
    GeneralLedger: state => state.others.GeneralLedger
};

const mutations = {
    [types.PERMISSIONS] (state, status) {
        state.permissions = status.permissions;
    },
    [types.OTHERS] (state, status) {
        state.others = status.others;
    }
};

export default {
    state,
    actions,
    getters,
    mutations
}
